Release 10.1A: OpenEdge Development:
Progress 4GL Handbook


Adding text to the window

There is one case of something you can add to a window that isn’t actually an object, and that is text.

To add text to your sample window:

  1. Select the Text icon from the Palette and click above the editor object to add a text field as a label for it:
  2. Note that the Object field in the AppBuilder window is not enabled. This is because the name the AppBuilder assigns to the text is not meaningful; it is simply TEXT- plus an integer ID. The name is not actually referenced within the code.

  3. Enter a Text value of Customer comments: for the text:
  4. Note that you have to include the colon if you want one because Progress does not automatically recognize this as a field label and does not add the colon for you.

  5. Stretch the text field in the design window to hold the text you entered and position it above the editor.
  6. This is the code the AppBuilder generates for the text field:

    DEFINE FRAME CustQuery 
         . 
         . 
         . 
         cBestWH AT ROW 19.33 COL 44 COLON-ALIGNED 
         ItemImage AT ROW 7.91 COL 81 
         RECT-1 AT ROW 15.76 COL 25 
         "Customer comments:" VIEW-AS TEXT 
              SIZE 25 BY .62 AT ROW 4.1 COL 78 
         WITH 1 DOWN NO-BOX KEEP-TAB-ORDER OVERLAY  
              SIDE-LABELS NO-UNDERLINE THREE-D  
              AT COL 1 ROW 1 
              SIZE 119.8 BY 19.62. 
    

    It is simply a literal value inserted into the frame definition. It has no name, and it is not created as an object with a handle or any attributes.

  7. You can change the font and color of the text in its limited property sheet if you wish:
  8. However, if you wanted to be able to manipulate the text in some way at run time, for example to change the value displayed when some event happens, you cannot do this because you have no access to the text at run time. If you want to access a text string as an object in this way, then you need to define it as a fill-in field rather than as text, and then set the VIEW-AS-TEXT attribute in its property sheet. The visual appearance will be the same as a simple text string, but the text is an object with a handle and attributes you can set and query at run time.

To see the final effects of all your changes, Run the window one more time:


Copyright © 2005 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095